// Package providers provides backward compatibility adapters
package providers

import (
	"gitee.com/zhenyangze/gin-framework/internal/pkg/container"
	"github.com/go-redis/redis"
	"gorm.io/gorm"
)

var (
	// Global container instance for backward compatibility
	globalContainer *container.Container
)

// InitGlobalContainer initializes the global container for backward compatibility
func InitGlobalContainer(c *container.Container) {
	globalContainer = c
}

// DB provides backward compatible access to database
var DB *gorm.DB

// Redis provides backward compatible access to Redis
var Redis *redis.Client

// InitDb initializes database compatibility layer
func InitDb() {
	if globalContainer != nil {
		DB = globalContainer.DB()
	}
}

// InitRedis initializes Redis compatibility layer  
func InitRedis() {
	if globalContainer != nil {
		Redis = globalContainer.Redis()
	}
}

// InitLogger initializes logger compatibility layer
func InitLogger() {
	// Logger handled by container
}

// InitEvent initializes event compatibility layer
func InitEvent() {
	// Event handled by container
}